﻿@echo off

@echo ------------------------------------------------------------------------------
@echo Installation of the ResourceClassGenerator custom tool for use in VS.NET 9.x
@echo ------------------------------------------------------------------------------

@echo.
@echo Preparing environment variables ...
@echo.

REM IF DEFINED VS90COMNTOOLS call %VS90COMNTOOLS%vsvars32.bat
REM IF DEFINED VS90COMNTOOLS call "%VS90COMNTOOLS%"vsvars32.bat

gacutil -i CodeGenerator.Mvvm.ViewModelGenerator.dll


@echo.
@echo Registering CodeGenerator.Mvvm.ViewModelGenerator assembly with COM ...
@echo.
regasm CodeGenerator.Mvvm.ViewModelGenerator.dll /codebase /tlb

@echo.
@echo Adding registry entries ...
@echo.


REM SET RegRoot=HKCU\SOFTWARE\Microsoft\VisualStudio

REM SET RegRoot=HKLM\Software\Microsoft\VisualStudio\9.0
REM SET RegRoot=HKCU\Software\Microsoft\VisualStudio\9.0Exp\Config
SET RegRoot=HKCU\Software\Microsoft\VisualStudio\10.0_Config
SET Key=ViewModelGenerator

rem VB
SET VB_GUID={164B10B9-B200-11D0-8C61-00A0C91E29D5}
REG ADD %RegRoot%\Generators\%VB_GUID%\%Key% /ve /t REG_SZ /d "VB Code Generator for ViewModel Classes" /f
REG ADD %RegRoot%\Generators\%VB_GUID%\%Key% /v CLSID /t REG_SZ /d {70AFD83A-45AD-4221-895C-FF841073DD39} /f
REG ADD %RegRoot%\Generators\%VB_GUID%\%Key% /v GeneratesDesignTimeSource /t REG_DWORD /d 00000001 /f

rem C#
SET CS_GUID={FAE04EC1-301F-11d3-BF4B-00C04F79EFBC}
REG ADD %RegRoot%\Generators\%CS_GUID%\%Key% /ve /t REG_SZ /d "C# Code Generator for ViewModel Classes" /f
REG ADD %RegRoot%\Generators\%CS_GUID%\%Key% /v CLSID /t REG_SZ /d {70AFD83A-45AD-4221-895C-FF841073DD39} /f
REG ADD %RegRoot%\Generators\%CS_GUID%\%Key% /v GeneratesDesignTimeSource /t REG_DWORD /d 00000001 /f

@echo.
@echo Setup complete.

@echo on